home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.tree;
-
- import java.util.EmptyStackException;
- import java.util.Enumeration;
- import java.util.NoSuchElementException;
- import java.util.Stack;
-
- final class DefaultMutableTreeNode$PathBetweenNodesEnumeration implements Enumeration {
- // $FF: synthetic field
- private final DefaultMutableTreeNode this$0;
- protected Stack stack;
-
- public DefaultMutableTreeNode$PathBetweenNodesEnumeration(DefaultMutableTreeNode var1, TreeNode var2, TreeNode var3) {
- this.this$0 = var1;
- if (var2 != null && var3 != null) {
- this.stack = new Stack();
- this.stack.push(var3);
- TreeNode var4 = var3;
-
- while(var4 != var2) {
- var4 = var4.getParent();
- if (var4 == null && var3 != var2) {
- throw new IllegalArgumentException("node " + var2 + " is not an ancestor of " + var3);
- }
-
- this.stack.push(var4);
- }
-
- } else {
- throw new IllegalArgumentException("argument is null");
- }
- }
-
- public boolean hasMoreElements() {
- return this.stack.size() > 0;
- }
-
- public Object nextElement() {
- try {
- return this.stack.pop();
- } catch (EmptyStackException var1) {
- throw new NoSuchElementException("No more elements");
- }
- }
- }
-